<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">

<ui:composition template="/templates/tmpl_game.xhtml">

	<ui:define name="centro">
		<h:form id="form">
			<p:messages id="messages" showDetail="true" autoUpdate="true" />
			
			<p:accordionPanel value="#{contratarMembroMBean.classificacoes}" var="classificacao">
				<p:tab title="#{classificacao.descricao}">
					<h:panelGrid columns="2" cellpadding="10">
						<p:outputLabel value="Equivalência:" />
						<p:outputLabel value="#{classificacao.qtdEquivalenciaUm}" />

						<p:outputLabel value="Valor" />
						<p:outputLabel value="#{classificacao.vlrContratar}" />
					</h:panelGrid>
					<p:commandButton value="Contratar" icon="ui-icon-person" update=":form:formulario"
						actionListener="#{contratarMembroMBean.contratar(classificacao)}" oncomplete="membroDialog.show()" />
				</p:tab>
			</p:accordionPanel>
			<br />
			<center>
				<p:commandButton value="Voltar" action="#{contratarMembroMBean.voltar}" icon="ui-icon-carat-1-w" />
			</center>

			<p:dialog header="Membro" widgetVar="membroDialog" resizable="false" showEffect="clip" hideEffect="fold">
				<h:panelGrid id="formulario" columns="2" cellpadding="4">

					<p:outputLabel value="Nome" for="nome" />
					<p:inputText id="nome" value="#{contratarMembroMBean.membro.nome}" />

					<p:commandButton action="#{contratarMembroMBean.salvar}" value="Salvar" oncomplete="membroDialog.hide()" update=":form:messages" />

				</h:panelGrid>
			</p:dialog>

		</h:form>
	</ui:define>

</ui:composition>

</html>
